i get an NameError although i defined my variable